package com.cqupt.mislab.erpn.controller.restart;

import com.cqupt.mislab.erpn.model.Result;
import com.cqupt.mislab.erpn.service.report.ReportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;

/**
 * @author 张烈文
 * @date 2021/10/7 12:02
 */
@RestController
@RequestMapping("/report")
public class ReportController {


    @Autowired
    private ReportService reportService;

    @GetMapping("/downLoadDoc")
    public Result downloadPersonReport(HttpSession session) {
        String userUnique = (String) session.getAttribute("userUnique");
        return reportService.downLoadReport(userUnique);
    }

    @GetMapping("/viewReport")
    public Result viewReport(HttpSession session) {
        String userUnique = (String) session.getAttribute("userUnique");
        return reportService.viewReport(userUnique);
    }

}
